@extends('layouts.default')
@section('content') 
<div class="box">
    <header>
        <div class="icons">
            <i class="fa fa-table"></i>
        </div>
        <h5>{{ Lang::get('messages.maintenance_history_head') }}</h5>
    </header><br/>
    <table id="dataTable" class="table table-bordered table-condensed table-hover table-striped">
        <thead>
            <tr>
                <th>{{Lang::get('messages.process')}}</th>
                <th>{{Lang::get('messages.milage')}}</th>
                <th>{{Lang::get('messages.date')}}</th>
                <th>{{Lang::get('messages.next_milage')}}</th> 
                <th>{{Lang::get('messages.next_date')}}</th>
                <th>{{Lang::get('messages.nr_invoice')}}</th> 
                <th>{{Lang::get('messages.service')}}</th> 
            </tr>
        </thead>
        <tbody>
            @foreach ($maintenance as $m)
            <tr>    
                <td>{{ Lang::get($m->process) }}</td>    
                <td>{{ $m->maint_milage}}</td>  
                <td>{{ $m->maintenance_date}}</td>  
                <td>{{ $m->maint_milage + $m->km_due}}</td> 
                <td>{{ Helpers\Helper::next_date($m->maintenance_date,$m->month_due)}}</td>
                <td>{{ $m->nr_invoice}}</td>
                <td>{{ $m->name}}</td>
            </tr>
            @endforeach
        </tbody>
    </table>
</div> 
@stop
